package com.javajun.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.javajun.custom.BaseService;
import com.javajun.entity.Menu;
import com.javajun.repository.MenuRepository;

@Service
public class MenuService extends BaseService<Menu, Integer>{

    @Autowired
    private MenuRepository menuRepository;
    
    public Menu findByRoleName(String roleCode) {
        return menuRepository.findByRoleName(roleCode);
    }
    
    public String getMenuByRoleCode(String roleCode) {
        Menu entity = findByRoleName(roleCode);
        return entity.getMenu();
    }
    
}
